package com.sunny.example;

import java.util.*;

public class test {
    public static void main(String[] args) {
//        String str = "I am a student";
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int num = scanner.nextInt();
            int tmp = num;//定义一个最小素数差,初始化时，给定输入值
            //将两个素数，跟它的差值绑定在一起
            Integer[] list = new Integer[2];
            for (int i = 2; i < num; i++) {
                boolean isSu = findSu(i);
                boolean isSecondSu = findSu(num - i);

                if (isSu && isSecondSu) {
                    //两个都是素数
                    int delta = Math.abs(num - 2 * i);
                    if (delta < tmp) {
                        tmp = delta;
                        list[0] = i;
                        list[1] = num - i;
                        Arrays.sort(list);
                    }
                }
            }
            for (Integer i : list) {
                System.out.println(i);
            }

        }

    }

    private static boolean findSu(int num) {
        if (num == 2) {
            return true;
        }
        int end = (int) Math.sqrt(num);
        boolean result = true; //默认是为素数
        for (int i = 2; i <= end; i++) {
            if (num % i == 0) { // 只要有一个能被整除，那这个就不是素数
                result = false;
            }
        }
        return result;
    }
}
